package com.bdqn.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class AddController {

    @GetMapping(value = "/add")
    public String add1(){
        return "add";
    }
    @PostMapping("/actionShow")
    public String submitAccount(@RequestParam("model") String model1,
                                @RequestParam("price") Double price,
                                @RequestParam("dataproduction") String dataproduction,
                                Model model) {
        // 将账号信息添加到Model中，以便在show.jsp页面中访问
        model.addAttribute("model1", model1);
        model.addAttribute("price", price);
        model.addAttribute("dataproduction", dataproduction);
        // 返回show.jsp页面的逻辑视图名
        return "save";
    }
}
